/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Tuan Nguyen
 */
@Entity
@Table(name = "RealEstate")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RealEstate.findAll", query = "SELECT r FROM RealEstate r"),
    @NamedQuery(name = "RealEstate.findByRealEstateID", query = "SELECT r FROM RealEstate r WHERE r.realEstateID = :realEstateID"),
    @NamedQuery(name = "RealEstate.findByLocation", query = "SELECT r FROM RealEstate r WHERE r.location = :location"),
    @NamedQuery(name = "RealEstate.findByDeposit", query = "SELECT r FROM RealEstate r WHERE r.deposit = :deposit"),
    @NamedQuery(name = "RealEstate.findByPrice", query = "SELECT r FROM RealEstate r WHERE r.price = :price"),
    @NamedQuery(name = "RealEstate.findByPriceType", query = "SELECT r FROM RealEstate r WHERE r.priceType = :priceType"),
    @NamedQuery(name = "RealEstate.findByNoOfBedrooms", query = "SELECT r FROM RealEstate r WHERE r.noOfBedrooms = :noOfBedrooms"),
    @NamedQuery(name = "RealEstate.findByNoOfBathrooms", query = "SELECT r FROM RealEstate r WHERE r.noOfBathrooms = :noOfBathrooms"),
    @NamedQuery(name = "RealEstate.findByExtraFacilities", query = "SELECT r FROM RealEstate r WHERE r.extraFacilities = :extraFacilities"),
    @NamedQuery(name = "RealEstate.findByModesOfTransport", query = "SELECT r FROM RealEstate r WHERE r.modesOfTransport = :modesOfTransport"),
    @NamedQuery(name = "RealEstate.findByFurniture", query = "SELECT r FROM RealEstate r WHERE r.furniture = :furniture"),
    @NamedQuery(name = "RealEstate.findByImageURL", query = "SELECT r FROM RealEstate r WHERE r.imageURL = :imageURL"),
    @NamedQuery(name = "RealEstate.findByModeOfPayment", query = "SELECT r FROM RealEstate r WHERE r.modeOfPayment = :modeOfPayment"),
    @NamedQuery(name = "RealEstate.findByTitle", query = "SELECT r FROM RealEstate r WHERE r.title = :title"),
    @NamedQuery(name = "RealEstate.findByBriefeDescription", query = "SELECT r FROM RealEstate r WHERE r.briefeDescription = :briefeDescription"),
    @NamedQuery(name = "RealEstate.findByAddDate", query = "SELECT r FROM RealEstate r WHERE r.addDate = :addDate"),
    @NamedQuery(name = "RealEstate.findByIsActive", query = "SELECT r FROM RealEstate r WHERE r.isActive = :isActive")})
public class RealEstate implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "RealEstateID")
    private Integer realEstateID;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "Location")
    private String location;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Deposit")
    private BigDecimal deposit;
    @Column(name = "Price")
    private BigDecimal price;
    @Size(max = 10)
    @Column(name = "PriceType")
    private String priceType;
    @Column(name = "NoOfBedrooms")
    private Integer noOfBedrooms;
    @Column(name = "NoOfBathrooms")
    private Integer noOfBathrooms;
    @Size(max = 500)
    @Column(name = "ExtraFacilities")
    private String extraFacilities;
    @Size(max = 100)
    @Column(name = "ModesOfTransport")
    private String modesOfTransport;
    @Column(name = "Furniture")
    private Boolean furniture;
    @Size(max = 50)
    @Column(name = "ImageURL")
    private String imageURL;
    @Size(max = 100)
    @Column(name = "ModeOfPayment")
    private String modeOfPayment;
    @Size(max = 100)
    @Column(name = "Title")
    private String title;
    @Size(max = 500)
    @Column(name = "BriefeDescription")
    private String briefeDescription;
    @Size(max = 10)
    @Column(name = "AddDate")
    private String addDate;
    @Column(name = "IsActive")
    private Boolean isActive;
    @JoinColumn(name = "RealEstateTypeID", referencedColumnName = "RealEstateTypeID")
    @ManyToOne(optional = false)
    private RealEstateType realEstateTypeID;
    @JoinColumn(name = "CreateUserID", referencedColumnName = "UserID")
    @ManyToOne
    private Member1 createUserID;
    @JoinColumn(name = "HouseTypeID", referencedColumnName = "HouseTypeID")
    @ManyToOne
    private HouseType houseTypeID;
    @JoinColumn(name = "ContactPersonID", referencedColumnName = "ContactPersonID")
    @ManyToOne
    private ContactPerson contactPersonID;
    @JoinColumn(name = "CityID", referencedColumnName = "CityID")
    @ManyToOne(optional = false)
    private Cities cityID;

    public RealEstate() {
    }

    public RealEstate(Integer realEstateID) {
        this.realEstateID = realEstateID;
    }

    public RealEstate(Integer realEstateID, String location) {
        this.realEstateID = realEstateID;
        this.location = location;
    }

    public Integer getRealEstateID() {
        return realEstateID;
    }

    public void setRealEstateID(Integer realEstateID) {
        this.realEstateID = realEstateID;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public BigDecimal getDeposit() {
        return deposit;
    }

    public void setDeposit(BigDecimal deposit) {
        this.deposit = deposit;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getPriceType() {
        return priceType;
    }

    public void setPriceType(String priceType) {
        this.priceType = priceType;
    }

    public Integer getNoOfBedrooms() {
        return noOfBedrooms;
    }

    public void setNoOfBedrooms(Integer noOfBedrooms) {
        this.noOfBedrooms = noOfBedrooms;
    }

    public Integer getNoOfBathrooms() {
        return noOfBathrooms;
    }

    public void setNoOfBathrooms(Integer noOfBathrooms) {
        this.noOfBathrooms = noOfBathrooms;
    }

    public String getExtraFacilities() {
        return extraFacilities;
    }

    public void setExtraFacilities(String extraFacilities) {
        this.extraFacilities = extraFacilities;
    }

    public String getModesOfTransport() {
        return modesOfTransport;
    }

    public void setModesOfTransport(String modesOfTransport) {
        this.modesOfTransport = modesOfTransport;
    }

    public Boolean getFurniture() {
        return furniture;
    }

    public void setFurniture(Boolean furniture) {
        this.furniture = furniture;
    }

    public String getImageURL() {
        return imageURL;
    }

    public void setImageURL(String imageURL) {
        this.imageURL = imageURL;
    }

    public String getModeOfPayment() {
        return modeOfPayment;
    }

    public void setModeOfPayment(String modeOfPayment) {
        this.modeOfPayment = modeOfPayment;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBriefeDescription() {
        return briefeDescription;
    }

    public void setBriefeDescription(String briefeDescription) {
        this.briefeDescription = briefeDescription;
    }

    public String getAddDate() {
        return addDate;
    }

    public void setAddDate(String addDate) {
        this.addDate = addDate;
    }

    public Boolean getIsActive() {
        return isActive;
    }

    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }

    public RealEstateType getRealEstateTypeID() {
        return realEstateTypeID;
    }

    public void setRealEstateTypeID(RealEstateType realEstateTypeID) {
        this.realEstateTypeID = realEstateTypeID;
    }

    public Member1 getCreateUserID() {
        return createUserID;
    }

    public void setCreateUserID(Member1 createUserID) {
        this.createUserID = createUserID;
    }

    public HouseType getHouseTypeID() {
        return houseTypeID;
    }

    public void setHouseTypeID(HouseType houseTypeID) {
        this.houseTypeID = houseTypeID;
    }

    public ContactPerson getContactPersonID() {
        return contactPersonID;
    }

    public void setContactPersonID(ContactPerson contactPersonID) {
        this.contactPersonID = contactPersonID;
    }

    public Cities getCityID() {
        return cityID;
    }

    public void setCityID(Cities cityID) {
        this.cityID = cityID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (realEstateID != null ? realEstateID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RealEstate)) {
            return false;
        }
        RealEstate other = (RealEstate) object;
        if ((this.realEstateID == null && other.realEstateID != null) || (this.realEstateID != null && !this.realEstateID.equals(other.realEstateID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "realEstateID=" + realEstateID + " ";
    }
    
}
